<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ page import="net.sureon.dao.*" %>
<%@ page import="net.sureon.common.DateFormat" %>
<%@page import="net.sureon.common.I18nSupport"%>

<%
	List<Application> all = null;
	all = (List<Application>)request.getAttribute("all");
 %>
 <%
int currentPage = (Integer)request.getAttribute("currentPage");
int pageCounter = (Integer)request.getAttribute("pageCounter");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>下属的申请</title>
	</head>
	<body>
	<jsp:include page="../header.jsp"></jsp:include>
			<div>
				<table cellpadding="0" cellspacing="0" class="style1">
					<tr>
						<td colspan="2">


							<table cellpadding="0" cellspacing="0" class="style5">
								<tr>
									<td style="text-align: left" bgcolor="#FFFBD6" class="style6">
										<table id="ctl00_ContentPlaceHolder1_Menu1"
											class="ctl00_ContentPlaceHolder1_Menu1_2" cellpadding="0"
											cellspacing="0" border="0">
											<tr>
												<td onmouseover="Menu_HoverStatic(this)"
													onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(this)"
													id="ctl00_ContentPlaceHolder1_Menu1n0">
													<table class="ctl00_ContentPlaceHolder1_Menu1_4"
														cellpadding="0" cellspacing="0" border="0" width="100%">
														<tr>
															<td style="white-space: nowrap;">
																<a
																	class="ctl00_ContentPlaceHolder1_Menu1_1 ctl00_ContentPlaceHolder1_Menu1_3"
																	href="<%=request.getContextPath() + "/user/underlingApplication.do" %>">待审批的申请</a>
															</td>

														</tr>
													</table>
												</td>
												<td style="width: 3px;"></td>
												<td onmouseover="Menu_HoverStatic(this)"
													onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(this)"
													id="ctl00_ContentPlaceHolder1_Menu1n1">
													<table
														class="ctl00_ContentPlaceHolder1_Menu1_4 ctl00_ContentPlaceHolder1_Menu1_9"
														cellpadding="0" cellspacing="0" border="0" width="100%">
														<tr>
															<td style="white-space: nowrap;">
																<a
																	class="ctl00_ContentPlaceHolder1_Menu1_1 ctl00_ContentPlaceHolder1_Menu1_3 ctl00_ContentPlaceHolder1_Menu1_8"
																	href="<%=request.getContextPath() + "/user/underlingReviewApplication.do" %>">已审批的申请</a>
															</td>
														</tr>
													</table>
												</td>
											</tr>
										</table>
									</td>

								</tr>
								<tr>
									<td style="text-align: left" class="style6">

										<table cellpadding="0" cellspacing="0" class="style5">
											<tr>
												<td style="text-align: left">
													<div>
														<table cellspacing="0" cellpadding="4" border="0"
															id="ctl00_ContentPlaceHolder1_GridView1"
															style="color: #333333; font-family: Arial; font-size: Small; width: 100%; border-collapse: collapse;">
															<tr align="center"
																style="color: White; background-color: #507CD1; font-weight: bold;">

																<th scope="col" style="color: White;">姓名</th>
																<th scope="col" style="color: White;">申请类别</th>
																<th scope="col" style="color: White;">开始日期</th>
																<th scope="col" style="color: White;">结束日期</th>
																<th scope="col" style="color: White;">累计时长</th>
																<th scope="col" style="color: White;">说明</th>
																<th scope="col" style="color: White;">审批时间</th>
																<th scope="col" style="color: White;">审批</th>
																<th scope="col" style="color: White;">状态</th>
															</tr>
													<%
														if(all == null || all.size() == 0) {
													%>
													<%	
														} else {

															String bgColor=null;
															String color_a = "#FFFFFF";
															String color_b = "#EFF3FB";														
															for (int i = 0; i < all.size(); i++) {
																bgColor = (i%2 == 0)?color_a:color_b;
																Application app = all.get(i);
															
													 %>		
															<tr align="center" style="background-color: <%=bgColor%>;">
																<td style="width: 75px;">
																<a href="<%=request.getContextPath() %>/user/underlingReviewApplication.do?showContent=true&applicationID=<%=app.getApplicationID() %>">
																<%=app.getAuthor().getRealName() == null ? "无" : app.getAuthor().getRealName() %>
																</a>
																</td>
																<td style="width: 60px;">
																	<%=I18nSupport.getMessage(app.getCategory()) %>
																</td>
																<td style="width: 75px;">
																	<%=app.getStartDate() %>
																</td>
																<td style="width: 75px;">
																	<%=app.getEndDate() %>
																</td>
																<td style="width: 60px;">
																	<%=app.getSumTime() %>
																</td>
																<td>
																	<%
																						String note = app.getNote();
																						if(note.length() > 73){
																							note = note.substring(0, 70);
																							note = note + "...";
																						}
																						out.print(note);
																						
																					 %>
																</td>
																<td style="width: 75px;">
																	<%=DateFormat.formatToDetail(app.getReviewDate()) %>
																</td>
																<td style="width: 75px;">
																	<%=app.getReviewer().getRealName() == null ? "无" : app.getReviewer().getRealName() %>
																</td>
																<td style="width: 60px;">
																	<%=I18nSupport.getMessage(app.getStatus()) %>
																</td>

															</tr>
													<%
															}
														}
													 %>		
															
														</table>
													</div>

												</td>
											</tr>

										</table>

									</td>
								</tr>
								<TR>
									<TD style="TEXT-ALIGN: center">
										<jsp:include page="../splitPage.jsp">
										<jsp:param name="url" value="/user/underlingReviewApplication.do"/>
										<jsp:param name="currentPage" value="<%=currentPage %>"/>
										<jsp:param name="pageCounter" value="<%=pageCounter %>"/>
										</jsp:include>
									</TD>
								</TR>								
								
								
									<FORM id=aspnetForm name=aspnetForm
								action="<%=request.getContextPath()%>/user/underlingReviewApplication.do"
								method=post>
								
									<TR>
										<TD>
											<DIV id=ctl00_ContentPlaceHolder1_Panel1>
												<TABLE class=style5 cellSpacing=0 cellPadding=0 width="689"
													height="90">
													<TBODY>
														<%
															Application app = (Application)request.getAttribute("application");
															if(app != null) {															
														 %>
													 <TR>
															<TD style="TEXT-ALIGN: left">
																<SPAN id=ctl00_ContentPlaceHolder1_Label4
																	style="FONT-SIZE: small">申请类别：</SPAN>
																	<SELECT
																			id=ctl00_ContentPlaceHolder1_DropDownList1
																			style="HEIGHT: 20px" name="category">
																														
																			<OPTION value="Over" <%="Over".equals(app.getCategory()) ? "selected" : "" %>>
																					加班
																			</OPTION>
																			<OPTION value="Vocation" <%="Vocation".equals(app.getCategory()) ? "selected" : "" %>>
																				休假
																			</OPTION>
																			<OPTION value="Leave" <%="Leave".equals(app.getCategory()) ? "selected" : "" %>>
																				请假
																			</OPTION>
																			<OPTION value="BusinessTrip" <%="BusinessTrip".equals(app.getCategory()) ? "selected" : "" %>>
																				出差
																			</OPTION>
																													
																	</SELECT>
															</TD>
															<TD style="TEXT-ALIGN: left">
																<SPAN id="xxxxxxxx" style="FONT-SIZE: small">开始日期：</SPAN>
																<INPUT id="startDate"
																	style="FONT-SIZE: small; WIDTH: 86px; HEIGHT: 16px"
																	value="<%=new java.text.SimpleDateFormat("yyyy-MM-dd").format(app.getStartDate())%>"
																	name="startDate" />
															</TD>
															<TD style="TEXT-ALIGN: left">
																<SPAN id="yyyyy" style="FONT-SIZE: small">结束日期：</SPAN>
																<INPUT id="endDate"
																	style="FONT-SIZE: small; WIDTH: 86px; HEIGHT: 16px"
																	value="<%=new java.text.SimpleDateFormat("yyyy-MM-dd").format(app.getEndDate())%>"
																	name="endDate" />
															</TD>
															<TD style="TEXT-ALIGN: right">
																<SPAN id=ctl00_ContentPlaceHolder1_Label7
																	style="FONT-SIZE: small">累计时长：</SPAN>
																<INPUT id=ctl00_ContentPlaceHolder1_TextBox3
																	style="FONT-SIZE: small; WIDTH: 30px; HEIGHT: 16px"
																	value=<%=app.getSumTime() %> name=sumTime />
																<SPAN id=ctl00_ContentPlaceHolder1_Label8
																	style="FONT-SIZE: small">小时</SPAN>
															</TD>
														</TR>
														<TR>
															<TD colSpan=4>
																<TEXTAREA id=ctl00_ContentPlaceHolder1_TextBox4
																	style="FONT-SIZE: small; WIDTH: 99.5%; HEIGHT: 80px"
																	name="note"><%=app.getNote() %></TEXTAREA>
															</TD>
														</TR>
													 
													 <%
													 	}
													  %>
												   <%-- 
														<TR>
															<input type="hidden" name="status" value="Pending" />
															<TD style="TEXT-ALIGN: center" colSpan=4>
																<INPUT id=ctl00_ContentPlaceHolder1_Button1 type=submit
																	value="提 交" name=ctl00$ContentPlaceHolder1$Button1
																	onclick="return checkDate();">
															</TD>
														</TR>
													--%>
														</FORM>
														
														
								
								
							</table>

						</td>
					</tr>
				</table>
			</div>
		<jsp:include page="../footer.jsp"></jsp:include>
	</body>
</html>
